import GameControl from './GameControl';

// 头条埋点
export default class TTAnalyticsApi {
    _TAG: any = "TTAnalyticsApi ";
    _versions: string = "v1.0";
    _isEnabled: boolean = window.TTASTATE;

    // 单例模式
    private static _instance: TTAnalyticsApi = null;
    public static getInstance() {
        if (this._instance == null) {
            this._instance = new TTAnalyticsApi();
        }
        return this._instance;
    }

    // 格式：Constants.TTAnalyticsApi.reportAnalytics('levleCount', { levle: 'set_value', });
    reportAnalytics(key, value) {
        if (!this._isEnabled) return;
        tt.reportAnalytics(key, value);
    }
}